package com.xxx.server.controller;

import com.alibaba.fastjson.JSONObject;
import com.xxx.server.pojo.Menu;
import com.xxx.server.service.IAdminService;
import com.xxx.server.service.IMenuService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

/**
 * 用于测试
 */
@RestController
public class TestController {
    @Resource
    private IAdminService iAdminService;

    @Autowired
    private IMenuService iMenuService;
    @GetMapping("/test")
    public String test(){
//        Admin admin = iAdminService.getById(1L);
//        return JSONObject.toJSONString(admin);
        List<Menu> menusWithRole = iMenuService.getMenusWithRole();
        return JSONObject.toJSONString(menusWithRole);
    }
}
